# _*_ coding : utf-8 _*_
# @Time : 2022/9/17 16:25
# @Author : Moonquake
# @File : customer
# @Project : base.py
import socket
# 配置连接
socketserver = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
host = '127.0.0.1'
port = 1920
# 连接
socketserver.bind((host,port))

socketserver.listen(5)
print("等待客户端连接....")
clientsocket,addr = socketserver.accept()
print("已建立初步连接，开始数据传输....")

while True:
    recvmsg = clientsocket.recv(1024)
    strData = recvmsg.decode("utf-8")
    if strData=="STOP":
        break
    else:
        print("收到:" + strData)

print("停止监听")
socketserver.close()


